package com.wx.nchu_mall.web;

import com.github.pagehelper.PageInfo;
import com.wx.nchu_mall.model.PageCondition;
import com.wx.nchu_mall.model.ReturngoodService;
import com.wx.nchu_mall.service.ReturngoodServiceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReturngoodServiceController {

    @Autowired
    protected ReturngoodServiceService returngoodServiceService;

    @PostMapping("/api/returngoodService/findList")
    public PageInfo<ReturngoodService> page(@RequestBody PageCondition<ReturngoodService> condition){
        return returngoodServiceService.page(condition);
    }

    @PostMapping("/api/returngoodService/add")
    public String add(@RequestBody ReturngoodService returngoodService){
        returngoodServiceService.insert(returngoodService);
        return "success";
    }
    @PostMapping("/api/returngoodService/update")
    public String update(@RequestBody ReturngoodService returngoodService){
        returngoodServiceService.update(returngoodService);
        return "success";
    }
}
